fix(hardening): security headers, rate limiting on /oauth2/token, env-var issuer URI#7
Merged
stupidly-logical merged 1 commit intomainfrom Apr 4, 2026
Merged
Conversation
5 tasks
…v-var issuer URI - Add HSTS, CSP, referrer policy, content-type-options response headers - Add Bucket4j rate limiter filter: 20 req/min per IP on POST /oauth2/token, returns 429 - Fix ProviderConfig to read issuer URI from OAUTH2_ISSUER_URI env var - Add oauth2.issuer-uri property to application.properties - Add bucket4j-core 8.10.1 dependency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6447784 to
50a0336
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RateLimitingFilteradded using Bucket4j: 20 requests/min per IP onPOST /oauth2/token; responds with HTTP 429 and RFC 6749-compliant JSON on exhaustionProviderConfignow reads issuer URI fromOAUTH2_ISSUER_URIenv var (was hardcoded tohttp://localhost:9000)oauth2.issuer-uriproperty added toapplication.propertiesbucket4j-core 8.10.1added topom.xmlFixes
Issues #16, #17, #18 from the production checklist.
Test plan
Strict-Transport-Security,Content-Security-Policy,Referrer-Policy,X-Content-Type-OptionsPOST /oauth2/tokenrequests from same IP returns HTTP 429{"error":"too_many_requests","error_description":"Rate limit exceeded"}OAUTH2_ISSUER_URI=https://auth.example.comreflects in/.well-known/oauth-authorization-serverresponse🤖 Generated with Claude Code